<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>商品列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('blog/Promotion/goodslist')}">
        用户ID：
        <input class="form-control" type="text" name="g_goodsname" style="width: 200px;" value="{:input('request.g_goodsname')}"
               placeholder="请输入用户ID">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('blog/Promotion/goodslist')}">清空</a>
    </form>
    <form action="{:url('blog/Promotion/zhePost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <table class="table table-hover table-bordered">
            <thead class="yyy">
            <tr>
                <th>商品名称</th>
                <th>商品图片</th>
                <th>价格</th>
                <th>商品数量</th>
                <th>商品状态</th>
                <th>请选择</th>
            </tr>
            </thead>
            <tbody class="tb">
            <php>
                $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
            </php>
           <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.g_goodsname}</td>
                    <td><img src="{:cmf_get_goods_blog_url($vo['g_pic'])}" class="headicon" width="40px;"/></td>
                    <td>{$vo.g_price}</td>
                    <td>{$vo.num}</td>
                    <!--<td><input type="radio" id="judge" name="judge"  value="{$vo.g_id}" class="form-control"  style="display: inline;width: 20%;height: 20px;"  />选择</td>-->
                    <td><?php $type = $vo['g_status'];switch($type){case 0: echo "商品关闭";break;case 1: echo "正常";break;}?></td>
                    <td>
                        <input type="radio" class="goodsid" id="goodsid" name="proid" value="{$vo.g_id}" width="40px" height="40px";>
                    <!--<a href="javascript:parent.openIframeLayer('{:url('Promotion/guige',array('nav_id'=>$vo['g_id']))}',{});">选择规格</a>-->
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
        <input type="button" name="button" id="button" value="确定" onclick="window_opener(this);">
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
<script>
function window_opener(){
  var obj=document.getElementsByName('proid'); //选择所有name="'test'"的对象，返回数组
  //取到对象数组后，我们来循环检测它是不是被选中
  var s='';
  for(var i=0; i<obj.length; i++){
    if(obj[i].checked) s+=obj[i].value; //如果选中，将value添加到变量s中
  }

  //那么现在来检测s的值就知道选中的复选框的值了
  if (s=='') {
    alert('你还没有选择任何内容！');
    return false;
  };

    
  window.opener.document.getElementById('proid').value=s;

  window.close();
}
</script>